package com.briup.day17;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Arrays;

/**
 * @author lining
 * @date 2024/1/29 10:15
 */
public class TestFileInputStream3 {
    public static void main(String[] args) throws Exception{
        //1.声明流
        InputStream in = null;
        //2.创建子类对象
        in = new FileInputStream("a.txt");
        //3.读操作(读取字节信息,将信息保存到数组对象中)
        byte[] data = new byte[3];
        int num = in.read(data);
        System.out.println("本次读取字节个数："+num);
        System.out.println("读取到哪些字节信息："+Arrays.toString(data));
        //4.关闭流 释放资源
        if(in != null) in.close();
    }
}
